package com.wynn.serviceFeign;

import com.wynn.pojo.Bom;
import com.wynn.pojo.Product;
import com.wynn.pojo.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient("serviceProviderBase")
public interface ProductClient {

    @GetMapping("product/selectAll")
    public Result selectAll();

    @PostMapping("product/add")
    public void add(Product product);

    @GetMapping("product/delete")
    public void delete(@RequestParam("id") int id);

    @PostMapping("product/edit")
    public void edit(Product product);

    @GetMapping("product/search")
    public Result search(@RequestParam("productModel")String productModel);

    @GetMapping("product/bom")
    public List<Bom> bom();

    @PostMapping("product/bomAdd")
    public void bomAdd(Bom bom);

    @GetMapping("product/deleteBom")
    public void deleteBom(@RequestParam("id") int id);

    @PostMapping("product/editBom")
    void editBom(Bom bom);

    @GetMapping("product/searchBom")
    List<Bom> searchBom(@RequestParam("name") String name);
}
